<template>
	<view>
	<uni-transition :mode-class="['fade','slide-right']" :show="curComponent==='Login'" :duration="500">
			<zgzLogin @showChild="receiveMsg"></zgzLogin>
			</uni-transition>
	<uni-transition :mode-class="['fade','slide-left']" :show="curComponent==='register'"  :duration="1000">
		<zgzRegister @showChild="receiveMsg"></zgzRegister>
		</uni-transition>

</view>
</template>
<script>
	import zgzRegister from '@/components/zgzRegister/zgzRegister.vue'
	import zgzLogin from '@/components/zgzLogin/zgzLogin.vue'
	
	export default{
		components: {
		zgzLogin,zgzRegister
		},
		data(){
			return{			
			curComponent:'Login'	//当前显示子组件是谁
				
			}
		},

		methods:{
			receiveMsg(msg){
				this.curComponent=msg.childName
			}
		}
		
		
	}
	
</script>